home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1996 April / Software of the Month Club 1996 April.iso / pc / os2 / psutils / cmd / fixfmps.cmd < prev    next >
Encoding:
Text File  |  1996-02-21  |  588 b   |  24 lines

  1. extproc perl5 -x
  2. #! perl5
  3.  
  4. # fixfmps: get conforming PostScript out of FrameMaker version 2 file
  5. # move all FMDEFINEFONTs to start of pages
  6. #
  7. # Copyright (C) Angus J. C. Duggan 1991-1995
  8. # See file LICENSE for details.
  9.  
  10. %fonts=();
  11.  
  12. while (<>) {
  13.    if (/^([0-9]+) [0-9]+ .* FMDEFINEFONT$/) {
  14.       $fonts{$1} = $_;
  15.    } elsif (/^[0-9.]+ [0-9.]+ [0-9]+ FMBEGINPAGE$/) {
  16.       print $_, join('',values(%fonts));
  17.    } elsif (m%(.*/PageSize \[paperwidth paperheight\]put )setpagedevice(.*)%) {
  18.       print "$1pop$2\n";
  19.    } else {
  20.       print $_;
  21.    }
  22. }
  23. # End of Script
  24.